Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup #3

Merged
merged 45 commits into from
Sep 26, 2023
Merged

Setup #3

merged 45 commits into from
Sep 26, 2023

Conversation

SKairinos
Copy link
Contributor

@SKairinos SKairinos commented Sep 19, 2023

This change is Reviewable

Copy link
Contributor Author

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 36 files reviewed, 1 unresolved discussion


backend/api/forms.py line 69 at r1 (raw file):

        validators=[
            RegexValidator(
                r"^[A-Z]{2}[0-9]{3}$",

validate 5 characters

Copy link
Contributor Author

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 36 files reviewed, 2 unresolved discussions


backend/service/settings.py line 50 at r1 (raw file):

]

ROOT_URLCONF = "service.urls"

make reusable settings

Copy link
Contributor Author

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 36 files reviewed, 3 unresolved discussions


backend/service/settings.py line 68 at r1 (raw file):

]

WSGI_APPLICATION = "service.wsgi.application"

reusable setting

Copy link
Contributor Author

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 36 files reviewed, 4 unresolved discussions


backend/service/settings.py line 83 at r1 (raw file):

# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [

reusable setting

Copy link
Contributor Author

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 36 files reviewed, 4 unresolved discussions


backend/service/settings.py line 83 at r1 (raw file):

Previously, SKairinos (Stefan Kairinos) wrote…

reusable setting

add TODO to create custom password validators

Copy link
Contributor

@faucomte97 faucomte97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 36 of 36 files at r1, all commit messages.
Reviewable status: all files reviewed, 8 unresolved discussions (waiting on @SKairinos)


.github/workflows/main.yaml line 28 at r1 (raw file):

        with:
          python-version: ${{ env.PYTHON_VERSION }}
      

Extra whitespaces


backend/api/forms.py line 69 at r1 (raw file):

Previously, SKairinos (Stefan Kairinos) wrote…

validate 5 characters

Reminder


backend/api/urls.py line 15 at r1 (raw file):

                    name="login",
                ),
                path(

Is there a reason why this URL path isn't in cron like the other cron jobs are in the portal-react and portal repos?


backend/api/views.py line 59 at r1 (raw file):

        session_objects: SessionManager = Session.objects

        before_session_count = session_objects.all().count()

Learnt this just the other day but it seems like you can just do session_objects.count() and it's the same 🤷‍♂️ https://docs.djangoproject.com/en/3.2/ref/models/querysets/#count


backend/api/views.py line 66 at r1 (raw file):

        call_command("clearsessions")

        after_session_count = session_objects.all().count()

Same here


backend/service/settings.py line 50 at r1 (raw file):

Previously, SKairinos (Stefan Kairinos) wrote…

make reusable settings

Reminder


backend/service/settings.py line 68 at r1 (raw file):

Previously, SKairinos (Stefan Kairinos) wrote…

reusable setting

Reminder


backend/service/settings.py line 83 at r1 (raw file):

Previously, SKairinos (Stefan Kairinos) wrote…

add TODO to create custom password validators

Reminder

Copy link
Contributor Author

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @faucomte97)


.github/workflows/main.yaml line 28 at r1 (raw file):

Previously, faucomte97 (Florian Aucomte) wrote…

Extra whitespaces

Done.


backend/api/urls.py line 15 at r1 (raw file):

Previously, faucomte97 (Florian Aucomte) wrote…

Is there a reason why this URL path isn't in cron like the other cron jobs are in the portal-react and portal repos?

Yes. It's part of a larger conversation I wanted to have about we organise our backend code. Basically, I want to organise all urls to be more object-oriented and have the following naming convention:

https://www.codeforlife.education/{service_name}/{object_name}/{function_name}/

For example, to create a new Game in the kurono service:
POST https://www.codeforlife.education/kurono/game/

So because we're mutating session objects:
GET (should be post but google requires get) https://www.codeforlife.education/sso/session/clear-expired/

Copy link
Contributor Author

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @faucomte97)


backend/api/urls.py line 15 at r1 (raw file):

Previously, SKairinos (Stefan Kairinos) wrote…

Yes. It's part of a larger conversation I wanted to have about we organise our backend code. Basically, I want to organise all urls to be more object-oriented and have the following naming convention:

https://www.codeforlife.education/{service_name}/{object_name}/{function_name}/

For example, to create a new Game in the kurono service:
POST https://www.codeforlife.education/kurono/game/

So because we're mutating session objects:
GET (should be post but google requires get) https://www.codeforlife.education/sso/session/clear-expired/

GET (should be DELETE but google requires GET) https://www.codeforlife.education/sso/session/clear-expired/


backend/api/views.py line 59 at r1 (raw file):

Previously, faucomte97 (Florian Aucomte) wrote…

Learnt this just the other day but it seems like you can just do session_objects.count() and it's the same 🤷‍♂️ https://docs.djangoproject.com/en/3.2/ref/models/querysets/#count

Done.


backend/api/views.py line 66 at r1 (raw file):

Previously, faucomte97 (Florian Aucomte) wrote…

Same here

Done.

Copy link
Contributor

@faucomte97 faucomte97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 6 of 6 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @SKairinos)

@SKairinos SKairinos merged commit ba55f15 into development Sep 26, 2023
@SKairinos SKairinos deleted the setup branch September 26, 2023 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants